.PHONY: all clean

all: output/main
	@echo "Build complete"

output/hello.so: src/hello.go
	@echo "Building hello.so"
	mkdir -p output
	go build -o output/hello.so -buildmode=c-shared src/hello.go

output/main: output/hello.so main.c
	@echo "Building main"
	mkdir -p output
	gcc -Iinclude -o output/main main.c output/hello.so -Wl,-rpath,./output

clean:
	rm -rf output

test: output/main
	cd output && ./main

